///@file Distribution.h
///@brief Declaration of the class defining a data distribution
///@author Arnaud Duval
///@version 0.0
///@date 2010/05/12

#ifndef DISTRIBUTION_H
#define DISTRIBUTION_H

#include <string>


///@class Distribution
///@brief Class defining a data distribution
class Distribution
{
	private:
		///@brief Array of data
		double *data;
		///@brief size of the distribution
		unsigned int size;
		///@brief Type of distribtion
		std::string type;
		///@brief Parameters of distribution
		double* params;
	public:
		///@brief Default constructor
		Distribution();
		///@brief Constructor with arguments
		Distribution(unsigned int, std::string, double, double);
		///@brief Copy constructor
		Distribution(const Distribution&);
		///@brief Copy constructor for temporary objects
		Distribution(Distribution*);
		///@brief Destructor
		~Distribution();
		///@brief Overload of [] operator : direct access to a realization
		double& operator[](unsigned int) const;
		///@brief Save distribution and its informations to a file
		void SaveToFile(std::string);
		///@brief Read distribution and its informations from a file
		void ReadFromFile(std::string);
		///@brief Return size of distribution
		unsigned int Size();
		///@brief Return array of data
		double *Data();
		///@brief Return average value of the distribution
		double Average();
		///@brief Return standard deviation of the distribution
		double StandardDeviation();
		///@brief Sort the distribution using bubble sort algorithm
		void BubbleSort();
		///@brief Return a confidence interval
		double* Confidence(double);
		///@brief Overload of << operator
		friend std::ostream& operator<<(std::ostream &, const Distribution&);
};


#endif